package com.zmn.plat.admin.controller.pic;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zmn.plat.business.interfaces.pic.PicUploadBService;

/**
 * @author duanzuocai
 * @version v1.0
 * @类说明：阿里去图片上传、读取
 * @since 2018/11/20 16:07
 */
@Controller
@RequestMapping("/pic/")
public class PicServiceController {

    @Autowired
    PicUploadBService picUploadBService;

    @RequestMapping("testUrl")
    public void categoryId(HttpServletResponse response, HttpServletRequest request) throws ServletException, IOException {

        String url = picUploadBService.getPicUrl("/sm/order", "04481230.jpg");

        response.sendRedirect(url);
    }
}
